Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate DBP permissions #2673

Merged
merged 15 commits into from
Apr 23, 2024
Merged

Validate DBP permissions #2673

merged 15 commits into from
Apr 23, 2024

Conversation

Bunn
Copy link
Collaborator

@Bunn Bunn commented Apr 22, 2024

Task/Issue URL: https://app.asana.com/0/1199230911884351/1207136634464353/f

Description:
Display error messages if DBP agent prerequisites aren't met

Steps to test this PR:

  1. Start from scratch (important to verify that we don't show any error if the agent hasn't started as well)
  2. Check the smoke test with scans and opt-outs
  3. Move the application to the desktop, open DBP, check if we correctly show the error page
  4. The Move button will not work if you're running it with de DEBUG flag. You can change this by changing the target scheme to release instead of debug
  5. Remove the background agent permission from system settings, check if we correctly show the error page

@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Apr 22, 2024
@Bunn Bunn removed the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Apr 22, 2024
@github-actions github-actions bot added the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Apr 22, 2024
@Bunn Bunn removed the bot: not in app board Added by automation for pull requests with tasks not added to macOS App Board Asana project label Apr 22, 2024
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved this to a different file since HomeViewController was getting a bit too crowded.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was always a bit random being in there anyway

Copy link
Contributor

github-actions bot commented Apr 22, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against f1c068b

@Bunn Bunn changed the base branch from main to release/1.85.0 April 22, 2024 14:46
@THISISDINOSAUR
Copy link
Contributor

THISISDINOSAUR commented Apr 22, 2024

Two current limitations:

  • If the tab is open and permissions disappear, doesn't handle. We do get an XPC error in this case, so we could add handling to check for possible causes when we get such an error. Don't think we should for this PR given the urgency though
  • If the user does enable permissions, we don't change the error screen until they close the DBP tab and reopen it. I think this is worth fixing more than the other issue. The only idea I can think of is checking every x seconds

Also, would be pretty slick and probably a positive impact on usage if after doing the application move the app opened with the DBP tab still open, but again not a priority for this PR IMO (but worth adding a follow up task for)

Otherwise behavior worked as expected

Copy link
Contributor

@THISISDINOSAUR THISISDINOSAUR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good!

I think we should prioritize follow up on better designs for this, can you add a task to the backlog?

DuckDuckGo/Common/Localizables/UserText.swift Show resolved Hide resolved
Copy link
Collaborator

@jotaemepereira jotaemepereira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bunn I’ve added some comments. I want to get your thoughts.

func checkStatus() -> DataBrokerPrerequisitesStatus
}

final class DefaultDataBrokerPrerequisitesStatusVerifier: DataBrokerPrerequisitesStatusVerifier {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Let’s add unit tests to this logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

DuckDuckGo/DBP/DBPHomeViewController.swift Outdated Show resolved Hide resolved
DuckDuckGo/DBP/DBPHomeViewController.swift Show resolved Hide resolved
@Bunn Bunn merged commit cd98077 into release/1.85.0 Apr 23, 2024
16 checks passed
@Bunn Bunn deleted the bunn/dbp/permission-check branch April 23, 2024 23:31
samsymons added a commit that referenced this pull request Apr 24, 2024
* main: (22 commits)
  Fix DataBrokerProtectionProcessor.swift lint
  Fix SwiftLint
  Add parameter allowed encoding to error descriptions (#2691)
  Remove debug flags
  Bump version to 1.85.0 (174)
  Revert interrupt logic (#2699)
  Fix downloads not appearing (#2693)
  Bump version to 1.85.0 (173)
  DBP interrupt fixes for release  (#2696)
  Bookmark All Tabs (#2683)
  Fix DBP interrupt function not being cleared on succesful completion (#2690)
  Bump version to 1.85.0 (172)
  Validate DBP permissions (#2673)
  Bump BSK (#2688)
  Add Untitled tab title (#2650)
  Stop first scan completed notification being sent if there's an error (#2685)
  DBP: Rename scanAllBrokers to startManualScan (#2679)
  macOS: Bundle-Specfic Autofill Secure Vault Keychain Items (#2652)
  Bump version to 1.85.0 (171)
  [Release PR] Link Lottie with the NetworkProtectionUI library (#2676)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants